jQuery(document).ready(function() {
  jQuery(window).load(function() {
    $ = jQuery;
    $(".flexslider > ul > li").each(function() {
      var height = $(this).height();
      var dstUri = (500 - height) / 2;
      $(this).find("img").attr("style", "margin-top:" + dstUri.toString() + "px !important;");
    });
    var a = $(".pro-thumnail").height();
    var b = $(".pro-thumnail").width();
    if (a > b) {
      $(".pro-thumnail").attr("style", "height:316px!important;;width:auto!important;");
    } else {
      $(".pro-thumnail").attr("style", "width:300px!important; height:auto!important;");
    }

    //remove iframe amazon error
    $('.crIFrame > p').has('script').remove();
    $('.crIFrame > #be').remove();
    $( 'p:empty' ).remove();
  });
});